// --------------------------------------------------------------------------------------------
// Version: MPL 1.1/GPL 2.0/LGPL 2.1
// 
// The contents of this file are subject to the Mozilla Public License Version
// 1.1 (the "License"); you may not use this file except in compliance with
// the License. You may obtain a copy of the License at
// http://www.mozilla.org/MPL/
// 
// Software distributed under the License is distributed on an "AS IS" basis,
// WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
// for the specific language governing rights and limitations under the
// License.
// 
// <remarks>
// Generated by IDLImporter from file nsIContentViewer.idl
// 
// You should use these interfaces when you access the COM objects defined in the mentioned
// IDL/IDH file.
// </remarks>
// --------------------------------------------------------------------------------------------
namespace Gecko
{
	using System;
	using System.Runtime.InteropServices;
	using System.Runtime.InteropServices.ComTypes;
	using System.Runtime.CompilerServices;
	
	
	/// <summary>
    ///This Source Code Form is subject to the terms of the Mozilla Public
    /// License, v. 2.0. If a copy of the MPL was not distributed with this
    /// file, You can obtain one at http://mozilla.org/MPL/2.0/. </summary>
	[ComImport()]
	[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
	[Guid("91b6c1f3-fc5f-43a9-88f4-9286bd19387f")]
	public interface nsIContentViewer
	{
		
		/// <summary>
        ///This Source Code Form is subject to the terms of the Mozilla Public
        /// License, v. 2.0. If a copy of the MPL was not distributed with this
        /// file, You can obtain one at http://mozilla.org/MPL/2.0/. </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void Init(System.IntPtr aParentWidget, System.IntPtr aBounds);
		
		[return: MarshalAs(UnmanagedType.Interface)]
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		nsIDocShell GetContainerAttribute();
		
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void SetContainerAttribute([MarshalAs(UnmanagedType.Interface)] nsIDocShell aContainer);
		
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void LoadStart(System.IntPtr aDoc);
		
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void LoadComplete(int aStatus);
		
		/// <summary>
        /// Checks if the document wants to prevent unloading by firing beforeunload on
        /// the document, and if it does, prompts the user. The result is returned.
        /// </summary>
		[return: MarshalAs(UnmanagedType.U1)]
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		bool PermitUnload();
		
		/// <summary>
        /// Exposes whether we're blocked in a call to permitUnload.
        /// </summary>
		[return: MarshalAs(UnmanagedType.U1)]
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		bool GetInPermitUnloadAttribute();
		
		/// <summary>
        /// As above, but this passes around the aShouldPrompt argument to keep
        /// track of whether the user has responded to a prompt.
        /// Used internally by the scriptable version to ensure we only prompt once.
        /// </summary>
		[return: MarshalAs(UnmanagedType.U1)]
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		bool PermitUnloadInternal([MarshalAs(UnmanagedType.U1)] ref bool aShouldPrompt);
		
		/// <summary>
        /// Exposes whether we're in the process of firing the beforeunload event.
        /// In this case, the corresponding docshell will not allow navigation.
        /// </summary>
		[return: MarshalAs(UnmanagedType.U1)]
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		bool GetBeforeUnloadFiringAttribute();
		
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void PageHide([MarshalAs(UnmanagedType.U1)] bool isUnload);
		
		/// <summary>
        /// All users of a content viewer are responsible for calling both
        /// close() and destroy(), in that order.
        ///
        /// close() should be called when the load of a new page for the next
        /// content viewer begins, and destroy() should be called when the next
        /// content viewer replaces this one.
        ///
        /// |historyEntry| sets the session history entry for the content viewer.  If
        /// this is null, then Destroy() will be called on the document by close().
        /// If it is non-null, the document will not be destroyed, and the following
        /// actions will happen when destroy() is called (*):
        /// - Sanitize() will be called on the viewer's document
        /// - The content viewer will set the contentViewer property on the
        /// history entry, and release its reference (ownership reversal).
        /// - hide() will be called, and no further destruction will happen.
        ///
        /// (*) unless the document is currently being printed, in which case
        /// it will never be saved in session history.
        ///
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void Close([MarshalAs(UnmanagedType.Interface)] nsISHEntry historyEntry);
		
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void Destroy();
		
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void Stop();
		
		[return: MarshalAs(UnmanagedType.Interface)]
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		nsIDOMDocument GetDOMDocumentAttribute();
		
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void SetDOMDocumentAttribute([MarshalAs(UnmanagedType.Interface)] nsIDOMDocument aDOMDocument);
		
		/// <summary>
        /// Returns DOMDocument as nsIDocument and without addrefing.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		System.IntPtr GetDocument();
		
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void GetBounds(System.IntPtr aBounds);
		
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void SetBounds(System.IntPtr aBounds);
		
		/// <summary>
        /// The previous content viewer, which has been |close|d but not
        /// |destroy|ed.
        /// </summary>
		[return: MarshalAs(UnmanagedType.Interface)]
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		nsIContentViewer GetPreviousViewerAttribute();
		
		/// <summary>
        /// The previous content viewer, which has been |close|d but not
        /// |destroy|ed.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void SetPreviousViewerAttribute([MarshalAs(UnmanagedType.Interface)] nsIContentViewer aPreviousViewer);
		
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void Move(int aX, int aY);
		
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void Show();
		
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void Hide();
		
		[return: MarshalAs(UnmanagedType.U1)]
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		bool GetStickyAttribute();
		
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void SetStickyAttribute([MarshalAs(UnmanagedType.U1)] bool aSticky);
		
		/// <summary>
        /// This is called when the DOM window wants to be closed.  Returns true
        /// if the window can close immediately.  Otherwise, returns false and will
        /// close the DOM window as soon as practical.
        /// </summary>
		[return: MarshalAs(UnmanagedType.U1)]
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		bool RequestWindowClose();
		
		/// <summary>
        /// Attach the content viewer to its DOM window and docshell.
        /// @param aState A state object that might be useful in attaching the DOM
        /// window.
        /// @param aSHEntry The history entry that the content viewer was stored in.
        /// The entry must have the docshells for all of the child
        /// documents stored in its child shell list.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void Open([MarshalAs(UnmanagedType.Interface)] nsISupports aState, [MarshalAs(UnmanagedType.Interface)] nsISHEntry aSHEntry);
		
		/// <summary>
        /// Clears the current history entry.  This is used if we need to clear out
        /// the saved presentation state.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void ClearHistoryEntry();
		
		/// <summary>
        /// Change the layout to view the document with page layout (like print preview), but
        /// dynamic and editable (like Galley layout).
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void SetPageMode([MarshalAs(UnmanagedType.U1)] bool aPageMode, [MarshalAs(UnmanagedType.Interface)] nsIPrintSettings aPrintSettings);
		
		/// <summary>
        /// Get the history entry that this viewer will save itself into when
        /// destroyed.  Can return null
        /// </summary>
		[return: MarshalAs(UnmanagedType.Interface)]
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		nsISHEntry GetHistoryEntryAttribute();
		
		/// <summary>
        /// Indicates when we're in a state where content shouldn't be allowed to
        /// trigger a tab-modal prompt (as opposed to a window-modal prompt) because
        /// we're part way through some operation (eg beforeunload) that shouldn't be
        /// rentrant if the user closes the tab while the prompt is showing.
        /// See bug 613800.
        /// </summary>
		[return: MarshalAs(UnmanagedType.U1)]
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		bool GetIsTabModalPromptAllowedAttribute();
		
		/// <summary>
        /// Returns whether this content viewer is in a hidden state.
        ///
        /// @note Only Gecko internal code should set the attribute!
        /// </summary>
		[return: MarshalAs(UnmanagedType.U1)]
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		bool GetIsHiddenAttribute();
		
		/// <summary>
        /// Returns whether this content viewer is in a hidden state.
        ///
        /// @note Only Gecko internal code should set the attribute!
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void SetIsHiddenAttribute([MarshalAs(UnmanagedType.U1)] bool aIsHidden);
		
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		System.IntPtr GetPresShellAttribute();
		
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		System.IntPtr GetPresContextAttribute();
		
		/// <summary>
        /// aDocument must not be null.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void SetDocumentInternal(System.IntPtr aDocument, [MarshalAs(UnmanagedType.U1)] bool aForceReuseInnerWindow);
		
		/// <summary>
        /// Find the view to use as the container view for MakeWindow. Returns
        /// null if this will be the root of a view manager hierarchy. In that
        /// case, if mParentWidget is null then this document should not even
        /// be displayed.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		System.IntPtr FindContainerView();
		
		/// <summary>
        /// Set collector for navigation timing data (load, unload events).
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void SetNavigationTiming(System.IntPtr aTiming);
		
		/// <summary>
        ///Scrolls to a given DOM content node.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void ScrollToNode([MarshalAs(UnmanagedType.Interface)] nsIDOMNode node);
		
		/// <summary>
        ///The amount by which to scale all text. Default is 1.0. </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		float GetTextZoomAttribute();
		
		/// <summary>
        ///The amount by which to scale all text. Default is 1.0. </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void SetTextZoomAttribute(float aTextZoom);
		
		/// <summary>
        ///The amount by which to scale all lengths. Default is 1.0. </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		float GetFullZoomAttribute();
		
		/// <summary>
        ///The amount by which to scale all lengths. Default is 1.0. </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void SetFullZoomAttribute(float aFullZoom);
		
		/// <summary>
        ///Disable entire author style level (including HTML presentation hints) </summary>
		[return: MarshalAs(UnmanagedType.U1)]
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		bool GetAuthorStyleDisabledAttribute();
		
		/// <summary>
        ///Disable entire author style level (including HTML presentation hints) </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void SetAuthorStyleDisabledAttribute([MarshalAs(UnmanagedType.U1)] bool aAuthorStyleDisabled);
		
		/// <summary>
        /// XXX comm-central only: bug 829543. Not the Character Encoding menu in
        /// browser!
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void GetForceCharacterSetAttribute([MarshalAs(UnmanagedType.LPStruct)] nsACStringBase aForceCharacterSet);
		
		/// <summary>
        /// XXX comm-central only: bug 829543. Not the Character Encoding menu in
        /// browser!
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void SetForceCharacterSetAttribute([MarshalAs(UnmanagedType.LPStruct)] nsACStringBase aForceCharacterSet);
		
		/// <summary>
        /// XXX comm-central only: bug 829543.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void GetHintCharacterSetAttribute([MarshalAs(UnmanagedType.LPStruct)] nsACStringBase aHintCharacterSet);
		
		/// <summary>
        /// XXX comm-central only: bug 829543.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void SetHintCharacterSetAttribute([MarshalAs(UnmanagedType.LPStruct)] nsACStringBase aHintCharacterSet);
		
		/// <summary>
        /// XXX comm-central only: bug 829543.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		int GetHintCharacterSetSourceAttribute();
		
		/// <summary>
        /// XXX comm-central only: bug 829543.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void SetHintCharacterSetSourceAttribute(int aHintCharacterSetSource);
		
		/// <summary>
        /// Requests the size of the content to the container.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void GetContentSize(ref int width, ref int height);
		
		/// <summary>
        ///The minimum font size </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		int GetMinFontSizeAttribute();
		
		/// <summary>
        ///The minimum font size </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void SetMinFontSizeAttribute(int aMinFontSize);
		
		/// <summary>
        /// Append |this| and all of its descendants to the given array,
        /// in depth-first pre-order traversal.
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void AppendSubtree(System.IntPtr array);
		
		/// <summary>
        /// Render the document as if being viewed on a device with the specified
        /// media type. This will cause a reflow.
        ///
        /// @param mediaType The media type to be emulated
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void EmulateMedium([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType = "Gecko.CustomMarshalers.AStringMarshaler")] nsAStringBase aMediaType);
		
		/// <summary>
        /// Restore the viewer's natural media type
        /// </summary>
		[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
		void StopEmulatingMedium();
	}
}
